package com.meviewer.utils;

import android.content.Intent;

import com.meviewer.activity.BaseActivity;

import java.util.function.Consumer;

/**
 * @author hanhaoran
 */
public class FileChooser<T extends BaseActivity> {

    private final T activity;
    private final int requestCode;

    public FileChooser(T activity, int requestCode) {
        this.activity = activity;
        this.requestCode = requestCode;
    }

    public void show() {
        Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
        intent.setType("*/*");
        intent.addCategory(Intent.CATEGORY_OPENABLE);
        activity.startActivityForResult(intent, requestCode);
    }

}
